package com.sxbbc.common.core.enums;

import java.util.ArrayList;
import java.util.List;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

/**
 * @author xiaoky
 * @description 拼团状态枚举
 * @date 2019-05-15
 */
public enum GroupStatusEnums {
	GROUP_CREATE(0, "创建中"),
	GROUP_ING(1, "进行中"),
	GROUP_ED(2, "已完成"),
	GROUP_REFUND(3, "已退款");
	
	private Integer id;
	 
    private String name;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private GroupStatusEnums(Integer id, String name) {
		this.id = id;
		this.name = name;
	}
    
	public static List<GroupStatusEnums> queryList(){
		List<GroupStatusEnums> list=new ArrayList<GroupStatusEnums>();
		for(GroupStatusEnums o:GroupStatusEnums.values()){
			list.add(o);
		}
		return list;
	}
	
	public static String getName(Integer id){
		String str="";
		for(GroupStatusEnums o:GroupStatusEnums.values()){
			if(CalcuUtils.getInstance().isEquals(id, o.getId())){
				str= o.getName();
				break;
			}
		}
		return str;
	}
}
